package java8Up.lambda.methodProxy;

/**
 * @author Fang Ruichuan
 * @date 2022-12-23 14:51
 */

public interface Finder {
    public int find(String s1, String s2);
}
class MyClass {
    public static int doFind(String s1, String s2) {
        return s1.lastIndexOf(s2);
    }
}

class TestClass {
    public static void main(String[] args) {
        Finder finder = ((s1, s2) -> MyClass.doFind(s1, s2));
        // ==
        Finder finder1 = MyClass::doFind;

        Finder finder2 = (s1, s2) -> s1.indexOf(s2);
        // ==
        Finder finder3 = String::indexOf;
    }
}
